package com.itheima.zixi3.StreamLiu;

import java.util.*;
import java.util.stream.Stream;

public class StreamLiu_01 {
    //1.获取Stream流
    public static void main(String[] args) {
        //1.1.数组获取Stream流
        String[] arr = {"张三", "李四", "王五", "赵六", "田七"};
        Stream<String> stream = Arrays.stream(arr);
        //1.2.集合获取Stream流
        //1.2.1List集合获取Stream流
        List<String> list = new ArrayList<>();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        list.add("赵六");
        Stream<String> stream1 = list.stream();
        //1.2.2Set集合获取Stream流
        Set<String> set = new HashSet<>();
        set.add("张三");
        set.add("李四");
        set.add("王五");
        set.add("赵六");
        Stream<String> stream2 = set.stream();
        //1.2.3Map集合获取Stream流
        Map<String, Double> map = new HashMap<>();
        map.put("张三", 98.9);
        map.put("李四", 97.9);
        map.put("王五", 97.9);
        map.put("赵六", 96.9);
        Stream<Map.Entry<String, Double>> stream3 = map.entrySet().stream();

    }
}
